package com.jxw.launcher.view;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import com.jxw.launcher.R;
import com.jxw.launcher.util.AESEncrypt;
import com.xuexiang.xqrcode.XQRCode;

/* loaded from: classes.dex */
public class QRCodeDialog extends Dialog {
    private ImageView iv_ewm;
    private ImageView iv_gb;
    private Context mContext;
    private String masterCode;

    public QRCodeDialog(Context context, String str) {
        super(context, R.style.ActionSheetDialogStyle);
        this.mContext = context;
        this.masterCode = str;
    }

    @Override // android.app.Dialog
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.dialog_qrcode);
        Window window = getWindow();
        WindowManager.LayoutParams attributes = window.getAttributes();
        window.setGravity(17);
        window.setAttributes(attributes);
        window.setLayout(-1, -2);
        setCanceledOnTouchOutside(true);
        setCancelable(true);
        getWindow().setDimAmount(0.3f);
        initView();
    }

    private void initView() {
        this.iv_ewm = (ImageView) findViewById(R.id.iv_ewm);
        this.iv_gb = (ImageView) findViewById(R.id.iv_gb);
        this.iv_ewm.setImageBitmap(XQRCode.createQRCodeWithLogo(AESEncrypt.encrypt(this.masterCode, AESEncrypt.key), 350, 350, null));
        this.iv_gb.setOnClickListener(new View.OnClickListener() { // from class: com.jxw.launcher.view.QRCodeDialog.1
            @Override // android.view.View.OnClickListener
            public void onClick(View view) {
                QRCodeDialog.this.dismiss();
            }
        });
    }
}
